<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Company extends Model
{
    use \App\Models\Traits\Company;
    
    protected $table = 't_companycnfo';
    
    protected $primaryKey = 'Co_ID';
    
    protected $fillable = [
        'Co_Name', 'Co_Logo', 'Co_ConnectionsNumber', 'is_default'
    ];
    
    protected $casts = [
        'is_default' => 'boolean',
        'Co_ID'=>'integer',
        'value'=>'integer',
    ];
    
    public function areas() {
        return $this->hasMany('\App\Models\Area', 'Co_ID', 'Co_ID');
    }
    
    public function sites() {
        return $this->hasMany('\App\Models\Site', 'company_id', 'Co_ID');
    }
}
